﻿<localControls:ImprovedChildWindow x:Class="Toon.Dialogs.SkillPicker"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
	xmlns:local="clr-namespace:Toon.Views"
	xmlns:localControls="clr-namespace:Toon.Controls"			
    xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" 
	x:Name="This"							   
	Title="Skills">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <StackPanel Margin="5">
                <TextBlock FontSize="20" Text="{Binding Name}" HorizontalAlignment="Center" />
                <Border BorderThickness="1" BorderBrush="Black" Width="40" Height="40" >
                    <TextBlock FontSize="20" Text="{Binding Value}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                </Border>
            </StackPanel>

            <ItemsControl ItemsSource="{Binding Skills}" Grid.Column="1" Margin="5">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.Resources>
                                <Style TargetType="TextBlock">
                                    <Setter Property="FontSize" Value="14" />
                                </Style>
                            </Grid.Resources>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="200" />
                                <ColumnDefinition Width="25" />
                                <ColumnDefinition Width="20" />
                                <ColumnDefinition Width="25" />
                            </Grid.ColumnDefinitions>

                            <Border BorderBrush="Black" BorderThickness="0,0,0,1" Grid.Column="0">
                                <TextBlock VerticalAlignment="Center" Text="{Binding Name}" Margin="0,0,5,0"  />
                            </Border>

                            <Button Visibility="{Binding SkillPoints, Converter={StaticResource MinusVisibility}}" Content="-" Margin="4" CommandParameter="{Binding}" Command="{StaticResource MinusCommand}" Grid.Column="1" />

                            <Border BorderBrush="Black" BorderThickness="0,0,0,1" Grid.Column="2">
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding SkillLevel}"/>
                            </Border>

                            <Button Visibility="{Binding SkillLevel, Converter={StaticResource PlusVisibility}}" Content="+" Margin="4" CommandParameter="{Binding}" Command="{StaticResource PlusCommand}" Grid.Column="3" />

                        </Grid>

                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </Grid>

        <Button Name="OKButton" Content="Close" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Center" Grid.Row="1" />
    </Grid>
</localControls:ImprovedChildWindow>
	
	
	